-- background: 16907 from stack: in -- bmap block id: 17929 -- flags: 0000 -- background id: 0 -- name: Six Monthly ----- HyperTalk script ----- on closeCard hide bkgnd button "Bracket" end closeCard on mouseUp --give a date in the week that was clicked on, (a month field) if the name of the target contains "name" or the name of the target contains "year" then exit mouseUp put the short name of the target & "name" into label put (item 2 of the clickLoc) - (item 2 of the rect of the target) into myDay put (myDay DIV textHeight of the target) +1 into myDay put word myDay of "1 8 15 22 29 36" into myDay put field label && myDay & "," && field "year" into myDate convert myDate to dateItems if item 7 of myDate = 1 then add 1 to item 3 of myDate --if using a Sunday, move into the next week goWeekly myDate end mouseUp on bracketWeek myDate --assume we are on the right card convert myDate to dateItems put item 2 of myDate into it if it > 6 then subtract 6 from it put "cal" & it into myField put ((item 3 of myDate) + 6 - (item 7 of myDate)) DIV 7 into it put loc of field myfield into newLoc put item 2 of rect of field myField into item 2 of newLoc add (it * the textHeight of field myField) + 7 to item 2 of newLoc show bkgnd button "bracket" at newLoc end bracketWeek on extendHalfYearly if the number of backgrounds > 1 then go to last card of bkgnd "weekly" get field "month" put word 2 of it && "1," && word 1 of it into endDate else put the seconds + (60*60*24*31) into endDate convert endDate to seconds go to last card of bkgnd "six monthly" put field cal6Name && "1," && field "year" into nowDate convert nowDate to seconds add 60*60*24*32 to nowDate --start of next 6 month period repeat until nowDate >= endDate doMenu "New Card" fillHalfYear nowDate add 60*60*24*183 to nowDate end repeat put the number of this card into it --last sixMonth card if (the number of backgrounds > 1) and (it > 5) then go to first card of bkgnd "Six Monthly" if the number of this card = 1 then repeat for it-5 --only allow 5 cards at the front doMenu "delete card" end repeat end if end if end extendHalfYearly on fillHalfYear startDate convert startDate to dateItems if item 2 of startDate is not in "1 7" then exit fillHalfYear put item 1 of startDate into field Year convert startDate to seconds repeat with ff = 1 to 6 put startDate into it convert it to long date put word 1 of item 2 of it into field ("cal" & ff & "name") put " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 " & "18 19 20 21 22 23 24 25 26 27 28" into field ("cal" & ff) convert it to dateItems put 1 into item 3 of it convert it to long date convert it to dateItems repeat (item 7 of it)-1 put " " before field ("cal" & ff) end repeat repeat with dd = 29 to 31 put dd into item 3 of it convert it to long date convert it to dateItems if item 3 of it = dd then put space & dd after field ("cal" & ff) else exit repeat end repeat put return after character 42 of field ("cal" & ff) put return after character 21 of field ("cal" & ff) add 60*60*24*31 to startDate end repeat end fillHalfYear on newStack put the seconds into myDate convert myDate to dateitems if item 2 of myDate > 6 then put 7 into item 2 of myDate else put 1 into item 2 of myDate fillHalfYear myDate end newStack -- part 7 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=12 top=59 right=85 bottom=103 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 2 -- text size: 14 -- style flags: 8448 -- line height: 18 -- part name: cal1name -- part 12 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=408 top=59 right=84 bottom=501 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 14 -- style flags: 8448 -- line height: 18 -- part name: cal4Name -- part 14 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=16 top=143 right=168 bottom=103 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 2 -- text size: 14 -- style flags: 8448 -- line height: 18 -- part name: cal2Name -- part 15 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=12 top=227 right=253 bottom=103 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 2 -- text size: 14 -- style flags: 8448 -- line height: 18 -- part name: cal3Name -- part 16 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=408 top=143 right=169 bottom=501 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 14 -- style flags: 8448 -- line height: 18 -- part name: cal5name -- part 17 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=408 top=227 right=253 bottom=502 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 14 -- style flags: 8448 -- line height: 18 -- part name: cal6name -- part 42 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=85 top=25 right=60 bottom=124 -- title width / last selected line: 0 -- icon id / first selected line: 4432 / 4432 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: To Do ----- HyperTalk script ----- on mouseUp visual effect zoom open go to first card of background "To Do" end mouseUp -- part 43 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=124 top=25 right=60 bottom=163 -- title width / last selected line: 0 -- icon id / first selected line: 21209 / 21209 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Daily ----- HyperTalk script ----- on mouseUp goWeekly the seconds end mouseUp -- part 57 (button) -- low flags: 80 -- high flags: 2002 -- rect: left=281 top=188 right=201 bottom=409 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Bracket ----- HyperTalk script ----- on mouseUp --should be behind all fields, but just in case hide bkgnd button "bracket" click at the loc of bkgnd button "bracket" end mouseUp -- part 46 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=164 top=25 right=60 bottom=203 -- title width / last selected line: 0 -- icon id / first selected line: 4263 / 4263 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseUp Answer "You are already here." with "OK" end mouseUp -- part 50 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=462 top=25 right=60 bottom=501 -- title width / last selected line: 0 -- icon id / first selected line: 14953 / 14953 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Home ----- HyperTalk script ----- on mouseUp visual effect iris close go "home" end mouseUp -- part 52 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=312 top=29 right=56 bottom=349 -- title width / last selected line: 0 -- icon id / first selected line: 22308 / 22308 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp go to next card end mouseUp -- part 53 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=275 top=28 right=56 bottom=312 -- title width / last selected line: 0 -- icon id / first selected line: 19381 / 19381 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prev ----- HyperTalk script ----- on mouseUp go to previous card end mouseUp -- part 54 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=9 top=25 right=58 bottom=85 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 24 -- style flags: 256 -- line height: 32 -- part name: Year -- part 55 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=101 top=64 right=143 bottom=230 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: cal1 -- part 56 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=101 top=148 right=227 bottom=230 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: cal2 -- part 58 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=101 top=232 right=311 bottom=230 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: cal3 -- part 59 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=281 top=64 right=143 bottom=410 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: cal4 -- part 60 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=281 top=148 right=227 bottom=410 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: cal5 -- part 61 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=281 top=232 right=311 bottom=410 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: cal6